package com.boliq.lol.ui.news;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.boliq.lol.R;
import com.boliq.lol.adapter.NewsArticleAdapter;
import com.boliq.lol.base.BaseFragment;
import com.boliq.lol.bean.NewsArticleBean;


public class NewsArticleFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private NewsArticleAdapter mAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_news_article;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.rv_content_list);
    }

    @Override
    protected void initData() {
       NewsArticleBean nb1=new NewsArticleBean("《英雄麦克疯》:忍界大战2.0 369一锤定音",R.drawable.icon_line1,"LOL","英雄联盟赛事官方","2");
       NewsArticleBean nb2=new NewsArticleBean("2021 LEC/LCS春季赛中文流延时直播将于本周奉上！",R.drawable.icon_line2,"LOL","英雄联盟赛事官方","1");
       NewsArticleBean nb3=new NewsArticleBean("选手靠谱时刻：宁王搞笑解说语录",R.drawable.icon_line3,"LOL","英雄联盟赛事官方","6");
       NewsArticleBean nb4=new NewsArticleBean("TOP5:369一锤定音 只身跃苍穹",R.drawable.icon_line4,"LOL","英雄联盟赛事官方","1");
       NewsArticleBean nb5=new NewsArticleBean("LPL春季赛3月8日首发名单，Xiaohu上路交手zs",R.drawable.icon_line5,"LOL","英雄联盟赛事官方","73");
       NewsArticleBean nb6=new NewsArticleBean("2021LPL春季赛第七周最佳阵容",R.drawable.icon_line7,"LOL","英雄联盟赛事官方","8");
       NewsArticleBean nb7=new NewsArticleBean("《LPL小蜜蜂观赛福袋》抽奖活动获奖玩家公示",R.drawable.icon_line6,"LOL","英雄联盟赛事官方","30");
       NewsArticleBean nb8=new NewsArticleBean("TOP5:Mole发条协奏背水终斩敌",R.drawable.icon_line8,"LOL","英雄联盟官方","6");

        mAdapter = new NewsArticleAdapter();
        mAdapter.addData(nb1);
        mAdapter.addData(nb2);
        mAdapter.addData(nb3);
        mAdapter.addData(nb4);
        mAdapter.addData(nb5);
        mAdapter.addData(nb6);
        mAdapter.addData(nb7);
        mAdapter.addData(nb8);

    }

    @Override
    protected void bindData() {
        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mAdapter);

    }

    @Override
    protected void bindEvent() {

    }
}
